home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_01_05 / 1n05047a < prev    next >
Text File  |  1990-09-04  |  197b  |  17 lines

  1.  
  2. unsigned long factorial(unsigned long n)
  3.     {
  4.     unsigned long result;
  5.  
  6.     if (n > 1LU)
  7.         {
  8.         for (unsigned long x = 2LU; x <= n; ++x)
  9.             {
  10.             result *= x;
  11.             }
  12.         }
  13.  
  14.     return result;
  15.     }
  16.  
  17.